import moment from 'moment';


/**
 *  {
        label: "账号",
        name:  "字段名",   //field-[like, in, ne]
        className: "publish-quill",
        form: {
            type: "Input",
            style: { width: 400 }
        }
    }
 */
const users = [
    {
        label: "账号",
        name: "username",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    },
    {
        label: "姓名",
        name: "realname-like",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    },
    {
        label: "部门",
        name: "dept_code",
        form: {
            type: "Select",
            placeholder: "请选择部门",
            label: "dept_name",
            value: "dept_code",
            api: "department",
            style: { width: 200 }

        }
    },
    {
        label: "角色",
        name: "role_code-contains",
        form: {
            type: "Select",
            placeholder: "请选择角色",
            label: "role_name",
            value: "role_code",
            api: "roles",
            style: { width: 200 }

        }
    }
  ]

  const college = [
    {
        label: "名称",
        name: "name-like",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    }
  ]

  const specialty = [
    {
        label: "名称",
        name: "name-like",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    }
  ]

  const course = [
    {
        label: "名称",
        name: "name-like",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    }
  ]

  const student = [
    {
        label: "学号",
        name: "student_no-like",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    },
    {
        label: "姓名",
        name: "name-like",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    }
  ]

const article = [
    {
        label: "标题",
        name: "title-like",
        form: {
            type: "Input"
        }
    },
    {
        label: "内容",
        name: "content-like",
        form: {
            type: "Input"
        }
    },
    {
        label: "创建时间",
        name: "create_at",
        form: {
            type: "RangePicker",
            style: { width: 400 },
            "format": "YYYY-MM-DD HH:mm:ss", 
            "showTime": { defaultValue: moment('00:00:00', 'HH:mm:ss')}
        }
    }
]


const question_bank = [
    {
        label: "题目",
        name: "subject-like",
        form: {
            type: "Input",
            style: { width: 200 }
        }
    },
    {
        label: "课程",
        name: "course_code",
        form: {
            type: "Select",
            placeholder: "请选择课程",
            label: "name",
            value: "code",
            api: "course",
            style: { width: 200 }

        }
    },
    {
        label: "题型",
        name: "subject_type",
        form: {
            type: "Select",
            placeholder: "请选择题型",
            label: "label",
            value: "value",
            // api: "course",
            data:[
                {label: "单选题", value: "single"},
                {label: "多选题", value: "multiple"},
                {label: '问答题', value: "questions"},
            ],
            style: { width: 200 }

        }
    }
  ]


export const searchs = {
    users,
    college,
    specialty,
    course,
    student,
    question_bank,
    article
}